<%@ page language="java"
	import="java.util.ArrayList"
	contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<%@taglib uri="/struts-tags" prefix="s" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>
		<base href="<%=basePath%>admin/basicInfo/customers/" />
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
		<link href="../../../css/skin.css" rel="stylesheet" type="text/css" />
		<script type="text/javascript">

 function changeState(obj, checkList) {
		if(obj.checked == true) {
			if(checkList != null && checkList.length == null) {
				checkList.checked = true;
			}
			for(var i=0; i<checkList.length; i++) {
				checkList[i].checked = true;
			}
		}
		else {
			if(checkList != null && checkList.length == null) {
				checkList.checked = false;
			}
			for(var i=0; i<checkList.length; i++) {
				checkList[i].checked = false;
			}
		}
	}
function noSelAll()
{
	for(i=0;i<document.form1.id.length;i++)
	{
		if(document.form1.id[i].checked)
		{
			document.form1.id[i].checked=false;
		}
	}
}

function deleteSelected(obj, checkList) {
		
		if(checkList.length == null) {
			if(checkList.checked == true) {
				if(!confirm("确定删除所选项?")) {
					return;
				}
				obj.submit();
			}
		}
		for(var i=0; i<checkList.length; i++) {
			if(checkList[i].checked == true) {
				if(!confirm("确定删除所选项?")) {
					return;
				}
				obj.submit();
				return;
			}
		}
	}

</script>
	</head>
	<body>
		<table width="100%" border="0" cellpadding="0" cellspacing="0">
			<tr>
				<td width="17" valign="top"
					background="../../../images/mail_leftbg.gif">
					<img src="../../../images/left-top-right.gif" width="17"
						height="29" />
				</td>
				<td valign="top" background="../../../images/content-bg.gif">
					<table width="100%" height="31" border="0" cellpadding="0"
						cellspacing="0" class="left_topbg" id="table2">
						<tr>
							<td height="31">
								<div class="titlebt">
									客户列表
								</div>
							</td>

						</tr>
					</table>
				</td>
				<td width="16" valign="top"
					background="../../../images/mail_rightbg.gif">
					<img src="../../../images/nav-right-bg.gif" width="16" height="29" />
				</td>
			</tr>
			<tr>
				<td valign="middle" background="../../../images/mail_leftbg.gif">
					&nbsp;
				</td>
				<td valign="top" bgcolor="#F7F8F9">

					<table width="98%" border="0" align="center" cellpadding="0"
						cellspacing="0">
						<tr>
							<td height="26" background="../../../images/newlinebg3.gif">

								<table width="98%" border="0" cellspacing="0" cellpadding="0">
									<tr>
										<td align="center">
												<a href="Customer-list.action" class="coolbg">客户列表</a>
												<a href="Customer-add.jsp" class="coolbg">增加客户信息</a>
												<a href="Customer-search.jsp" class="coolbg">查询客户信息</a>
										</td>
									</tr>
								</table>

								<form name="form1" action="Customer-deleteSelected.action">
									<table width="98%" border="0" cellpadding="2" cellspacing="1"
										bgcolor="#D1DDAA" align="center" style="margin-top: 8px">
										<tr bgcolor="#E6EDF2">
											<td height="24" colspan="15"
												background="../../../images/tbg.gif">
												&nbsp;
												<input type="checkbox" class="coolbg" name="all"
													onclick="changeState(this, selectedList);" value="check" />
												<label class="coolbg">
													全选
												</label>
												<input type="submit" class="coolbg1" value="删除"
						onclick="deleteSelected(form1,document.getElementsByName('selectedList'));" />
											</td>
										</tr>
										<tr align="center" bgcolor="#EEF4EA" height="22">
											<td width="4%">
												编号
											</td>
											<td width="3%">
												选择
											</td>
											<td width="8%">
												名称
											</td>
											<td width="5%">
												简称
											</td>
											<td width="7%">
												地址
											</td>
											<td width="7%">
												电话
											</td>
											<td width="8%">
												E-mail
											</td>
											<td width="6%">
												邮政编码
											</td>
											<td width="7%">
												开户行
											</td>
											<td width="8%">
												账号
											</td>
											<td width="7%">
												传真
											</td>
											<td width="6%">
												联系人
											</td>
											<td width="7%">
												联系电话
											</td>
											<td width="7%">
												购买总额
											</td>
											<td width="8%">
												操作
											</td>
										</tr>
										<s:iterator value="customers" var="c">
										<tr align='center' bgcolor="#FFFFFF"
											onMouseMove="javascript:this.bgColor='#FCFDEE';"
											onMouseOut="javascript:this.bgColor='#FFFFFF';" height="22">
											<td>
												<s:property value="#c.id"/>
											</td>
											<td>
												<input type="checkbox" id="selectedList" name="selectedList" value="<s:property value="#c.id"/>"
													class="np">
											</td>
											<td>
												<s:property value="#c.customer_name"/>
											</td>
											<td >
												<s:property value="#c.short_name"/>
											</td>
											<td>
												<s:property value="#c.address"/>
											</td>
											<td>
												<s:property value="#c.tel"/>
											</td>
											<td>
												<s:property value="#c.email"/>
											</td>
											<td>
												<s:property value="#c.postalcode"/>
											</td>
											<td>
												<s:property value="#c.bank_name"/>
											</td>
											<td>
												<s:property value="#c.bank_account"/>
											</td>
											<td>
												<s:property value="#c.fax"/>
											</td>
											<td>
												<s:property value="#c.linkman_name"/>
											</td>
											<td>
												<s:property value="#c.linkman_tel"/>
											</td>
											<td>
												<s:property value="#c.total_purchase_money"/>
											</td>
											<td>
												<a href="Customer-update?customer.id=<s:property value="#c.id"/>">编辑</a> |
												<a href="Customer-delete?customer.id=<s:property value="#c.id"/>">删除</a>
											</td>
										</tr>
										</s:iterator>
										<tr bgcolor="#FAFAF1">
											<td height="28" colspan="15">
												<a href="" class="coolbg">上一页</a>
												<a href="" class="coolbg">&nbsp;1&nbsp;</a>
												<a href="" class="coolbg">&nbsp;2&nbsp;</a>
												<a href="" class="coolbg">&nbsp;3&nbsp;</a>
												<a href="" class="coolbg">&nbsp;...&nbsp;</a>
												<a href="" class="coolbg">&nbsp;下一页&nbsp;</a>
												<input type="text" size="3" class="input" />
												<a href="" class="coolbg">go</a>
											</td>
										</tr>
										<tr align="right" bgcolor="#EEF4EA">
											<td height="36" colspan="15" align="center">
												<!--·­Ò³´úÂë -->
											</td>
										</tr>
									</table>
								</form>
							</td>
						</tr>
					</table>

				</td>
				<td background="../../../images/mail_rightbg.gif">
					&nbsp;
				</td>
			</tr>
			<tr>
				<td valign="bottom" background="../../../images/mail_leftbg.gif">
					<img src="../../../images/buttom_left2.gif" width="17" height="17" />
				</td>
				<td background="../../../images/buttom_bgs.gif">
					<img src="../../../images/buttom_bgs.gif" width="17" height="17">
				</td>
				<td valign="bottom" background="../../../images/mail_rightbg.gif">
					<img src="../../../images/buttom_right2.gif" width="16" height="17" />
				</td>
			</tr>
		</table>
		<s:debug/>
	</body>
</html>
